package com.yzf.demo.demo.DesignPattren.AbstractfactoryPattern.crossborder;

import com.yzf.demo.demo.DesignPattren.AbstractfactoryPattern.crossborder.AppleVaerification.AppleFaceVerification;
import com.yzf.demo.demo.DesignPattren.AbstractfactoryPattern.crossborder.AppleVaerification.AppleFingerprintVerification;

/**
 * Created by 于占峰 on 2020/2/24/024.
 */
public class ApplePay extends ICrossBorderPay {
    public String getPay(String orderNumber, Double payNumber, String payPwType) {
        boolean result = false;
        switch (payPwType) {
            case "指纹":
                result = new AppleFingerprintVerification().verification(payPwType);
                break;
            case "面部":
                result = new AppleFaceVerification().verification(payPwType);
                break;
        }
        if (result) {
            return "订单:" + orderNumber + ",使用Apple付款" + payNumber;
        } else {
            return "验证失败";
        }
    }

}
